Software Disclaimer

Class UML 2.5::Extension

Description:

An extension is used to indicate that the properties of a metaclass are extended through a stereotype, and gives the ability to flexibly add (and later remove) stereotypes to classes.

Direct Superclasses: Association

Direct Subclasses:

Class Precedence List: Extension, Association, Relationship, Classifier, Namespace, Type, PackageableElement, ParameterableElement, TemplateableElement, RedefinableElement, NamedElement, Element

Properties:

isRequired : Boolean (1 1); -- source Extension

Indicates whether an instance of the extending stereotype must be created when an instance of the extended class is created. The attribute value is derived from the value of the lower property of the ExtensionEnd referenced by Extension::ownedEnd; a lower value of 1 means that isRequired is true, but otherwise it is false. Since the default value of ExtensionEnd::lower is 0, the default value of isRequired is false.
{readonly, derived}

metaclass : Class (1 1); -- source Extension
ownedEnd : ExtensionEnd (1 1); -- source Extension
endType : Type (1 *); -- source Association
isDerived : Boolean (1 1); -- source Association
memberEnd : Property (2 *); -- source Association
navigableOwnedEnd : Property (0 *); -- source Association
relatedElement : Element (1 *); -- source Relationship
attribute : Property (0 *); -- source Classifier
collaborationUse : CollaborationUse (0 *); -- source Classifier
feature : Feature (0 *); -- source Classifier
general : Classifier (0 *); -- source Classifier
generalization : Generalization (0 *); -- source Classifier
inheritedMember : NamedElement (0 *); -- source Classifier
isAbstract : Boolean (1 1); -- source Classifier
isFinalSpecialization : Boolean (1 1); -- source Classifier
ownedTemplateSignature : RedefinableTemplateSignature (0 1); -- source Classifier
ownedUseCase : UseCase (0 *); -- source Classifier
powertypeExtent : GeneralizationSet (0 *); -- source Classifier
redefinedClassifier : Classifier (0 *); -- source Classifier
representation : CollaborationUse (0 1); -- source Classifier
substitution : Substitution (0 *); -- source Classifier

The Substitutions owned by this Classifier.
{composite}
Subsets: Element.ownedElement, NamedElement.clientDependency
Opposite: Substitution.substitutingClassifier

templateParameter : ClassifierTemplateParameter (0 1); -- source Classifier
useCase : UseCase (0 *); -- source Classifier
elementImport : ElementImport (0 *); -- source Namespace
importedMember : PackageableElement (0 *); -- source Namespace
member : NamedElement (0 *); -- source Namespace

A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance.
{readonly}
Derived union with sources: (ownedRule, ownedMember, importedMember, ownedUseCase, inheritedMember, feature, attribute, memberEnd, ownedEnd)

ownedMember : NamedElement (0 *); -- source Namespace
ownedRule : Constraint (0 *); -- source Namespace
packageImport : PackageImport (0 *); -- source Namespace
package : Package (0 1); -- source Type
visibility : VisibilityKind (0 1); -- source PackageableElement
owningTemplateParameter : TemplateParameter (0 1); -- source ParameterableElement
templateBinding : TemplateBinding (0 *); -- source TemplateableElement
isLeaf : Boolean (1 1); -- source RedefinableElement
redefinedElement : RedefinableElement (0 *); -- source RedefinableElement
redefinitionContext : Classifier (0 *); -- source RedefinableElement
clientDependency : Dependency (0 *); -- source NamedElement
name : String (0 1); -- source NamedElement
nameExpression : StringExpression (0 1); -- source NamedElement
namespace : Namespace (0 1); -- source NamedElement
qualifiedName : String (0 1); -- source NamedElement
ownedComment : Comment (0 *); -- source Element
ownedElement : Element (0 *); -- source Element
owner : Element (0 1); -- source Element

Constraints:

No additional constraints.

Operations:

Signature: metaclassEnd() : Property;
Description: The query metaclassEnd() returns the Property that is typed by a metaclass (as opposed to a stereotype).
The OCL used here is not normative.
Editor's notes: Rewritten to find the memberEnd that is a ExtensionEnd.
Expression: memberEnd->select(type.oclIsKindOf(Stereotype))->any(true)
Original: result = (memberEnd->reject(p | ownedEnd->includes(p.oclAsType(ExtensionEnd)))->any(true))

Signature: metaclass.1() : Class;
Description: The query metaclass() returns the metaclass that is being extended (as opposed to the extending stereotype).
Expression: result = (metaclassEnd().type.oclAsType(Class))

Signature: isRequired.1() : Boolean;
Description: The query isRequired() is true if the owned end has a multiplicity with the lower bound of 1.
Expression: result = (ownedEnd.lowerBound() = 1)



Send questions or comments to [email protected].